// 获取状态

$(document).ready(function () {
	//setTimeout(onInit, 1000);

	var port = chrome.extension.connect({name: "ContentScripts"});
	port.postMessage({mtype: "get"});
	port.onMessage.addListener(function(msg) {
		//alert(msg.name + "," + msg.pwd);
		
		$("#username").val(msg.name);
		$("#password").attr('value', msg.pwd);
		
		$('.signinbutton').click();
	});
	
});

function onInit() {
	$("#username").val('hanzhe');
	$("#password").attr('value', 'kele2016');

	setTimeout(onWaitClick, 1000);
}

function onWaitClick() {
	$('.signinbutton').click();
}


